package com.demo.service;

import com.demo.dao.UserMapper1;
import com.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService1 {
    @Autowired
    private UserMapper1 userMapper1;

    public List<User> getAllUser(){
        return userMapper1.getAllUsers();
    }

    public List<User> getUsersByName(String name){
        return userMapper1.getUsersByName(name);
    }

    public User getUserById(Long id){
        return userMapper1.getUserById(id);
    }

    public Integer addUser(User user){
        return userMapper1.addUser(user);
    }

    public Integer updateUserById(User user){
        return userMapper1.updateUserById(user);
    }

    public Integer deleteUserById(Integer id){
        return userMapper1.deleteUserById(id);
    }
}
